import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.net.ServerSocket;
import java.net.Socket;


public class Server {
	
	public static void main(String[] args) throws IOException, ClassNotFoundException{
		ServerSocket ss = new ServerSocket(3000);
		Socket client  = ss.accept();//listen to make connection
		System.out.print("Client found!");
		FileWriter file = new FileWriter("ChatList.txt",true);
		SocketChat sc = new SocketChat(client,file);
		sc.chat();
//		client.close();
		ss.close();
	}
}
